import { http } from '../service';

// 审批流程
export function approveFlow(data: any) {
  return http.middleware({
    url: `/ctms/Rest/projectTaskFlow/auditWorkFlow`,
    method: 'POST',
    data,
  });
}

// 退回流程
export function backFlow(data: any) {
  return http.middleware({
    url: `/ctms/Rest/projectTaskFlow/returnWorkFlow`,
    method: 'POST',
    data,
  });
}
// 拒绝流程
export function rejectFlow(data: any) {
  return http.middleware({
    url: `/ctms/Rest/projectTaskFlow/rejectProcess`,
    method: 'POST',
    data,
  });
}

// 获取下一节点所有信息
export function getNextNode(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectTaskFlow/getNextNodeInfo`,
    method: 'GET',
    params,
  });
}

// 获取需要发起人设置节点审批人的节点
export function getFlowDynamicApprovals(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectTaskFlow/getFlowDynamicApprovals`,
    method: 'GET',
    params,
  });
}

//根据任务id获取任务流程（项目中心端）
export function getTaskFlow(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectTaskFlow/list`,
    method: 'GET',
    params,
  });
}
